package cn.jk.config;

import org.springframework.beans.factory.config.BeanDefinition;
import org.springframework.beans.factory.support.BeanDefinitionRegistry;
import org.springframework.beans.factory.support.BeanNameGenerator;

public class MyBeanNameGenerator implements BeanNameGenerator {
	@Override
	public String generateBeanName(BeanDefinition definition, BeanDefinitionRegistry registry) {
		String beanClassName = definition.getBeanClassName();
//		registry.registerBeanDefinition(beanClassName,definition);
		String[] split = beanClassName.split("\\.");
		String s = split[split.length - 1];
		String re = s.substring(0,1).toLowerCase() + s.substring(1);
		return re;
	}
}
